﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
using pinduoduo.Util;

namespace 群发广告
{
    public partial class TestWindow : Form
    {
        private ChromiumWebBrowser chromeBrowser;
        public TestWindow()
        {
            InitializeComponent();
        }

        private void TestWindow_Load(object sender, EventArgs e)
        {
            InitializeChromium();
        }

        //初始化浏览器并启动
        public void InitializeChromium()
        {
            //var settings = new CefSettings
            //{
            //    Locale = "zh-CN"
            //};

            //settings.CachePath = AppDomain.CurrentDomain.BaseDirectory + "caches\\";
            //settings.PersistSessionCookies = true;
            //settings.PersistUserPreferences = true;

            //Cef.Initialize(settings);

            chromeBrowser = new ChromiumWebBrowser("http://yangkeduo.com/");

            chromeBrowser.KeyboardHandler = new CEFKeyBoardHander();

            this.panel1.Controls.Add(chromeBrowser);
   
        }

    }
}
